local scene_obj = require "scene_obj"


local M = setmetatable({}, scene_obj)
M.__index = M

function M.new(obj)
    -- if not obj then
    --     obj = {}
    --     obj.uid = nil
    --     obj.nickname = nil
    --     obj.exp = nil
    --     obj.gold = nil
    --     obj.diamond = nil
    --     obj.status = nil
    --     obj.bag = {}  
    -- end
    obj = obj or {}

    obj = scene_obj.new(obj)

    return setmetatable(obj, M)
end

function M:set_uid(uid)
    self.uid = uid
end

function M:ser_username(username)
    self.username = username
end

function M:set_nickname(nickname)
    self.nickname = nickname
end

function M:set_exp(exp)
    self.exp = exp
end

function M:set_gold(gold)
    self.gold = gold
end

function M:set_diamond(diamond)
    self.diamond = diamond
end

function M:set_status(status)
    self.status = status
end

function M:get_uid()
    return self.uid or 0
end

function M:get_username()
    return self.username or ""
end

function M:get_nickname()
    return self.nickname or "default nickname"
end

function M:get_exp()
    return self.exp or 0
end

function M:get_gold()
    return self.gold or 0
end

function M:get_diamond()
    return self.diamond or 0
end

function M:get_status()
    return self.status
end

function M:get_player_base_info()
    return {
        uid = self:get_uid(),
        username = self:get_username(),
        nickname = self:get_nickname(),
        exp = self:get_exp(),
        gold = self:get_gold(),
        diamond = self:get_diamond(),
    }
end

function M:get_player_info()
    return {
        uid = self:get_uid(),
        username = self:get_username(),
        nickname = self:get_nickname(),
        exp = self:get_exp(),
        gold = self:get_gold(),
        diamond = self:get_diamond(),
        fight_info = self:get_fight_info(),
        scene_info = self:get_scene_info(),
    }
end


return M